#include "vector.hpp"
void test1()
{
    hcc::vector<int> l;
    l.push_back(1);
    l.push_back(2);
    l.push_back(3);
    l.push_back(3);
    l.push_back(3);
    cout<<l.capacity()<<endl;
    l.push_back(3);
    l.push_back(3);
    hcc::vector<int>::iterator it=l.begin();
    for(auto e : l)
        cout<<e<<",";
    cout<<endl;
}
void test2()
{
    hcc::vector<int> l;
    l.push_back(1);
    l.push_back(2);
    l.push_back(3);
    l.push_back(3);
    l.push_back(3);
    hcc::vector<int> s;
    s=l;
    for(auto e : s)
        cout<<e<<",";
    cout<<endl;
}
void test3()
{
    hcc::vector<int> k;
    cout<<k.capacity()<<endl;
    cout<<k.size()<<endl;
   // k.resize(10,1);
    cout<<k.capacity()<<endl;
    cout<<k.size()<<endl;
     for(auto e : k)
        cout<<e<<",";
    cout<<endl;
}
void test4()
{
    std::vector<int> l;
    l.push_back(1);
    l.push_back(2);
    l.push_back(3);
    l.push_back(3);
    l.push_back(3);
    std::vector<int>::iterator it=l.begin()+1;
    l.insert(it,5);
    for(auto e:l)
        cout<<e<<",";
    cout<<endl;
}
void test5()
{
    hcc::vector<int> l;
    l.push_back(1);
    l.push_back(2);
    l.push_back(3);
    l.push_back(3);
    l.push_back(3);
    for(auto e:l)
        cout<<e<<",";
    cout<<endl;
    l.erase(l.end());
    for(auto e:l)
        cout<<e<<",";
}
void test6()
{
    class Solution {
public:
    void generate(int numRows) 
    {
        hcc::vector<hcc::vector<int>> vv;
        size_t i=0;
        size_t j=0;
        vv.resize(numRows);
        for(i=0;i<vv.size();i++)
        {
            vv[i].resize(i+1);
            vv[i].front()=vv[i].back()=1;
        }
        for(i=2;i<vv.size();i++)
        {
            for(j=1;j<vv[i-1].size();j++)
            {
                vv[i][j]=vv[i-1][j-1]+vv[i-1][j];
            }
        }
        size_t k=0;
        size_t l=0;
        for(k=0;k<vv.size();k++)
        {
            for(l=0;l<vv[k].size();l++)
            {
                cout<<vv[k][l]<<" ";
            }
            cout<<endl;
        }
    }
};
 Solution().generate(5);
}
int main()
{
    //test1();
    //test2();
    //test3();
    //test4();
    //test5();
    test6();
    return 0;
}
